package com.roi.njzk_big_api.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;


/**
 *
 * Created by rendunyun on 2019/6/17.
 * @version 1.0
 */
@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {

    /**
     * 解决服务器和pc前端报403错误----跨域问题;异常处理链添加异常
     *
     * @param registry 跨域参数
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**");
    }

    /**
     * 异常处理链添加异常
     * @param exceptionResolvers 异常链接参数集合
     */
    @Override
    public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers){

    }


}

